<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateIaassetsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('iaassets', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('iaasset_no', 100)->index('vassetis_iaasset_no_index')->comment('SP视频媒资编号');
			$table->string('name', 100);
			$table->string('title', 100)->nullable();
			$table->string('subtitle', 100)->nullable();
			$table->decimal('score', 3, 1)->nullable();
			$table->string('season', 100)->nullable()->comment('第几季');
			$table->integer('episode')->nullable()->comment('第几集');
			$table->integer('vcat_id')->unsigned()->index('vassetis_vcat_id_index')->comment('归类 如电影\电视剧\综艺');
			$table->text('short_desc', 65535)->nullable();
			$table->text('long_desc', 65535)->nullable();
			$table->timestamps();
			$table->softDeletes();
			$table->dateTime('firstdate')->nullable()->comment('首播日期');
			$table->dateTime('online_at')->nullable()->comment('上线时间');
			$table->dateTime('offline_at')->nullable()->comment('下线时间');
			$table->integer('listorder')->default(0);
			$table->boolean('online_status')->nullable()->default(0)->comment('上线状态 状态 0 未审核 1 审核中 2 审核不通过 3 审核通过');
			$table->boolean('moderate_status')->nullable()->default(0)->comment('审核状态 状态 0 未审核 1 审核中 2 审核不通过 3 审核通过');
			$table->boolean('publish_status')->nullable()->default(0)->comment('发布状态 状态 0 未审核 1 审核中 2 审核不通过 3 审核通过');
			$table->integer('user_id')->unsigned()->default(1)->comment('编辑用户ID');
			$table->boolean('publish_down_status')->default(1)->comment('不明白');
			$table->boolean('charge_type')->default(0)->comment('是否收费 1收费 0免费');
			$table->integer('iaasset_type')->default(0)->comment('是否有剧集 1 是 0 否');
			$table->integer('serials')->unsigned()->nullable()->default(0)->comment('总集数');
			$table->integer('upto')->unsigned()->nullable()->default(0)->comment('更新到');
			$table->integer('subvcat_id')->nullable()->default(0)->comment('子归类');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('iaassets');
	}

}
